package flash.sound.file.wave {
  
  import flash.sound.file.wave.tag.AbstractWaveTag;
  import flash.sound.file.wave.tag.IWaveTag;
  import flash.sound.file.wave.tag.WaveDataTag;
  import flash.sound.file.wave.tag.WaveFormatTag;
  import flash.sound.file.wave.tag.header.IWaveTagHeader;
  
  public final class WaveTagFactory {
    
    public static const FORMAT_TAG_ID: String = "fmt ";
    
    public static const DATA_TAG_ID: String = "data";
    
    public static function createWaveTag(header: IWaveTagHeader): IWaveTag {
      var tag: IWaveTag;
      switch (header.id) {
        case FORMAT_TAG_ID: 
          tag = new WaveFormatTag();
          break;
        
        case DATA_TAG_ID: 
          tag = new WaveDataTag();
          break;
        
        default:
          tag = new AbstractWaveTag();
      }
      tag.header = header;
      return tag;            
    }
  }
}